package gameHandling;

import javax.microedition.lcdui.Graphics;

import main.PlayingCanvas;

public abstract class PlaceHandling extends ExtendHandling{
	protected int rowIndex=-1;
	protected int colIndex=-1;
	public void paint(Graphics g){
		
		int cols = PlayingCanvas.getGame().tiledMap.getColumns();
		int rows = PlayingCanvas.getGame().tiledMap.getRows();
		int w = PlayingCanvas.getGame().tiledMap.getCellWidth();
		int h = PlayingCanvas.getGame().tiledMap.getCellHeight();
		int y = PlayingCanvas.getGame().getY();

		g.setColor(0x880000);	
		for(int i=0;i<cols;i++)
		{
			for(int j=0;j<rows;j++)
			{
				if(PlayingCanvas.getGame().objectMap[i][j]>0)
				{
					g.drawRect(i*w+1,j*h+y+1 , w-3, h-3);
				}
			}
			g.drawRect(i*w+1,y+1 , w-3, h-3);
		}
		if(rowIndex != -1)
		{
			g.setColor(0x00ff00);
			g.drawRect(colIndex*w+1,rowIndex*h+y+1 , w-3, h-3);
		}
	}
}
